package com.yuanzong.wuliu.controller.admin.base;

import com.yuanzong.wuliu.service.admin.base.AdminCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@RestController
@Api(tags = "管理端 - 验证码模块")
@RequestMapping("/admin/base/code")
@Slf4j
public class AdminCodeController {

    @Autowired
    private AdminCodeService adminCodeService;

    @ApiOperation("图片验证码")
    @RequestMapping(value = "/photo", method = {RequestMethod.GET})
    public void photo(HttpServletRequest request, HttpServletResponse response, String photoCodeKey) throws Exception {
        adminCodeService.photo(request, response, photoCodeKey);
    }

}
